<!--
 * @Author: xjt
 * @Date: 2021-06-26 14:56:24
 * @LastEditTime: 2021-06-26 16:38:15
 * @Description: 人员综合管理新增编辑页
 * @LastEditors: xjt
-->
<template>
  <el-dialog
    custom-class="small-padding-dialog"
    :title="dialogTitle"
    :visible.sync="dialogVisible"
    width="70%"
    @close="handleClosed"
  >
    <div class="basic-form">
      <el-form ref="form" class="form-wrap" size="small" :model="formData">
        <el-form-item label="隔离点名称" prop="hotelName">
          <el-select v-model="formData.hotelName" placeholder="请选择">
            <!-- <el-option
							v-for="item in options"
							:key="item.value"
							:label="item.label"
							:value="item.value">
            </el-option>-->
          </el-select>
        </el-form-item>
        <el-form-item label="旅客入住来源" prop="dataSource">
          <el-input v-model="formData.dataSource" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="批次号" prop="batchNum">
          <el-input v-model="formData.batchNum" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="姓名" prop="name">
          <el-input v-model="formData.name" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="性别" prop="gender">
          <el-input v-model="formData.gender" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="年龄" prop="age">
          <el-input v-model="formData.age" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="国籍或地区" prop="nationCity">
          <ProvinceCity v-model="formData.nationCity" />
          <!-- <el-input v-model="formData.aaa" placeholder="请输入" /> -->
        </el-form-item>
        <el-form-item label="证件类型" prop="cardType">
          <el-input v-model="formData.cardType" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="证件号码" prop="cardId">
          <el-input v-model="formData.cardId" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="护照" prop="passportNum">
          <el-input v-model="formData.passportNum" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="电话号码" prop="telPhone">
          <el-input v-model="formData.telPhone" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="目的地" prop="destinationCity">
          <ProvinceCity v-model="formData.destinationCity" />
          <!-- destinationProvince/destinationCity -->
          <!-- <el-input v-model="formData.bbb" placeholder="请输入" /> -->
        </el-form-item>
        <el-form-item label="目的地详细地址" prop="destinationAddr">
          <el-input v-model="formData.destinationAddr" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="来自所在国或地区" prop="comeCountryCity">
          <el-input v-model="formData.comeCountryCity" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="入境方式" prop="entryWay">
          <el-input v-model="formData.entryWay" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="入境时间" prop="entryTime">
          <el-input v-model="formData.entryTime" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="核酸检验情况" prop="nucleinTestCase">
          <el-input v-model="formData.nucleinTestCase" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否在校留学生" prop="isOverStudent">
          <el-input v-model="formData.isOverStudent" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否有境外旅居史" prop="isYjwLjs">
          <el-input v-model="formData.isYjwLjs" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否机组人员" prop="isAircrew">
          <el-input v-model="formData.isAircrew" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否入境奔丧人员" prop="isMourning">
          <el-input v-model="formData.isMourning" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否孕妇" prop="isGravida">
          <el-input v-model="formData.isGravida" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否有明显的身体疾病" prop="isBodyDisease">
          <el-input v-model="formData.isBodyDisease" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否有基础疾病" prop="isBasicDisease">
          <el-input v-model="formData.isBasicDisease" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否属于前科人员" prop="isCriminalPerson">
          <el-input v-model="formData.isCriminalPerson" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="是否存在精神异常或者心理异常" prop="isSpiritHeartExce">
          <el-input v-model="formData.isSpiritHeartExce" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="风险等级" prop="riskLevel">
          <el-input v-model="formData.riskLevel" placeholder="请输入" />
        </el-form-item>
        <el-form-item class="full" label="备注" prop="remark">
          <el-input v-model="formData.remark" placeholder="请输入" />
        </el-form-item>
        <div class="card-title full">紧急联系人</div>
        <el-form-item label="紧急联系人关系" prop="emergencyContactType">
          <el-input v-model="formData.emergencyContactType" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="紧急联系人姓名" prop="emergencyContactName">
          <el-input v-model="formData.emergencyContactName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="紧急联系人电话" prop="emergencyContactPhone">
          <el-input v-model="formData.emergencyContactPhone" placeholder="请输入" />
        </el-form-item>
        <div class="card-title full">信息核实情况</div>
        <el-form-item label="核验是否通过" prop="verifyResult">
          <el-input v-model="formData.verifyResult" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="核验人" prop="verifyName">
          <el-input v-model="formData.verifyName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="核验结果说明" prop="verifyRemark">
          <el-input v-model="formData.verifyRemark" placeholder="请输入" />
        </el-form-item>
        <div class="card-title">证件（正反面拍照上传）</div>
        <div class="full">
          <v-upload type="image" :busId="formData.userId" modelType :isView="false"></v-upload>
        </div>
        <div class="card-title full">行程列表</div>
        <div class="full">
          <el-button @click="editRouteCol('add')">新增</el-button>
          <el-table :data="routes" style="width: 100%" :model="routeslist">
            <el-table-column type="index" width="50" />
            <el-table-column prop="outAddrProvince/outAddrCity" label="出发地" width="180">
              <template>
                <el-cascader v-model="routeslist.outAddr" :options="options"></el-cascader>
              </template>
            </el-table-column>
            <el-table-column prop="outDate" label="出发时间" width="180">
              <template>
                <el-date-picker type="datetime" placeholder="选择日期时间"></el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="getAddrProvince/getAddrCity" label="到达地">
              <template>
                <el-cascader v-model="routeslist.getAddr" :options="options"></el-cascader>
              </template>
            </el-table-column>
            <el-table-column prop="getDate" label="到达时间">
              <template>
                <el-date-picker type="datetime" placeholder="选择日期时间"></el-date-picker>
              </template>
            </el-table-column>
            <el-table-column prop="tripTrafficWay" label="出行交通方式">
              <template>
                <el-select v-model="routeslist.tripTrafficWay" :options="tripOptions"></el-select>
              </template>
            </el-table-column>
            <el-table-column prop="flightNumber" label="出行交通方式牌号">
              <template>
                <el-cascader v-model="routeslist.flightNumber" :options="flightOptions"></el-cascader>
              </template>
            </el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button @click="editRouteCol('move')">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-form>
    </div>
    <div slot="footer">
      <!--<el-button @click="$bus.$emit('operationLog',formData.billId)" v-if="type==='preview'">操作日志</el-button>-->
      <el-button
        v-if="type !== 'preview'"
        type="primary"
        @click="save"
      >{{type == 'approval' ? '审 批':'提 交'}}</el-button>
      <el-button @click="dialogVisible = false">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import ProvinceCity from '@/components/ProvinceCity'
export default {
  name: 'editDialog',
  components: {
    ProvinceCity
  },
  props: {
    // 场景
    scene: {
      type: String,
      default: 'add'
    },
  },
  data() {
    return {
      formData: {
      },
      routes: [],
      routeslist: [],
      dialogVisible: false,
      dialogTitle: '编辑',
      options: [],
      tripOptions: [],
      flightOptions: [],
      type:''
    }
  },
  methods: {
    async show({ type, row, dialogTitle }) {
      this.type = type;
      this.dialogVisible = true;
      this.dialogTitle = dialogTitle;
    },
    save() {
      const param = { jdglPersonInfo: { ...this.formData } }
    },
    editRouteCol(type) {
      switch (type) {
        case 'add':
          return this.routes.push({})
        case 'move':
          return this.routes.pop()
        default:
          break;
      }
    },
    handleClosed() {

    }
  }
}
</script>

<style lang="scss" scoped>
</style>
